import request from '@/utils/request'

// 查询生产产品列表
export function listProductionProducts(query) {
  return request({
    url: '/production-service/production/productionProducts/list',
    method: 'get',
    params: query
  })
}

// 查询生产产品详细
export function getProductionProducts(productId) {
  return request({
    url: '/production-service/production/productionProducts/' + productId,
    method: 'get'
  })
}
export function getProductionProductsByRouteId(routeId) {
  return request({
    url: 'production-service/production/productionProductsByOne/' + routeId,
    method: 'get'
  })
}
// 新增生产产品
export function addProductionProducts(data) {
  return request({
    url: '/production-service/production/productionProducts',
    method: 'post',
    data: data
  })
}

// 修改生产产品
export function updateProductionProducts(data) {
  return request({
    url: '/production-service/production/productionProducts',
    method: 'put',
    data: data
  })
}

// 删除生产产品
export function delProductionProducts(productId) {
  return request({
    url: '/production-service/production/productionProducts/' + productId,
    method: 'delete'
  })
}
export function productionWithCount(data) {
  return request({
    url: '/production-service/production/update/ProductsWithCount',
    method:'post',
    data:data
  })
}

export function insertProductionWithCount(data){
  return request({
    url:'/production-service/production/insert/productsWithCount',
    method:'post',
    data:data
  })
}